//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// This test checks that if no hardening mode is defined (i.e., in the unchecked mode), by default assertions aren't
// triggered.

// UNSUPPORTED: libcpp-has-hardened-mode, libcpp-has-debug-mode, libcpp-has-assertions

#include <cassert>

static bool executed_condition = false;
static bool f() { executed_condition = true; return false; }

extern "C" int main(int, char**) {
  _LIBCPP_ASSERT_UNCATEGORIZED(true, "Should not fire");
  _LIBCPP_ASSERT_UNCATEGORIZED(false, "Also should not fire");
  _LIBCPP_ASSERT_UNCATEGORIZED(f(), "Should not execute anything");
  assert(!executed_condition); // Really make sure we did not execute anything.

  return 0;
}
